var app = new Vue({
	el: '#app',
	data: {
        openId: '',
        repairId:'',
        speed: '',
        service: '',
        level: '',
        evaluateOther: ''
    },
    mounted: function () {
		this.$nextTick(function () {
            app.repairId = getUrlParam('id');
            Server.getFromCustomer('/searchRepairDataById', {id: app.repairId}, function (result) {
                //响应速度
                app.speed = result.data.evaluateResponseSpeed;
                //服务态度
                app.service = result.data.evaluateServiceAttitude;
                //维修水品
                app.level = result.data.evaluateMaintenanceLevel;
                //其他评价
                app.evaluateOther = result.data.evaluateOther;
			});
        });
    },
    methods:{
        submit:function(){
            var evaluateInfo = {
                evaluateResponseSpeed:app.speed,
                evaluateServiceAttitude:app.service,
                evaluateMaintenanceLevel:app.level,
                evaluateOther:app.evaluateOther
            }
            Server.postToCustomer('/evaluate',{id: app.repairId, evaluateInfo: JSON.stringify(evaluateInfo)}, function(result){
                if(result.code == 100){
                    mui.toast("评价成功!");
                }
            });
        }
    }
});